<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1. 定义数组
    let arr = ["张三", "李四", "王五", "赵六", "孙七"];
    // 2. 随机取一个数
    let randomIndex = Math.floor(Math.random() * arr.length);
    // 3. 输出随机取的数
    console.log(arr[randomIndex]);
    // 4. 删除数组中随机取的数
    arr.splice(randomIndex, 1);
    // 5. 输出删除后的数组
    console.log(arr);
  </script>
</body>
</html>